package com.suapi.suapiinterface.controller;

import cn.hutool.json.JSONUtil;
import com.suapi.suapiclientsdk.Until.SignUtils;
import com.suapi.suapiclientsdk.model.User;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/name")
public class NameController {

    @GetMapping
    public String getName(@RequestParam String name) {
        return "GET 你的名字：" + name;
    }

    @PostMapping
    public String postName(@RequestParam String name) {
        return "POST 你的名字：" + name;
    }

    @PostMapping("/name")
    public String postNameByJson(@RequestBody User user, HttpServletRequest request) {
        String result = "POST json 你的名字：" + user.getUsername();
        return result;
    }

}
